<template>
    <div>
      <el-table :data="warehouseInfos">
        <el-table-column prop="id" label="编号"></el-table-column>
        <el-table-column prop="warName" label="仓库名"></el-table-column>
        <el-table-column prop="warMaxStock" label="仓库最大库存"></el-table-column>
        <el-table-column label="操作">
          <template slot="header" slot-scope="scope">
            <el-input
              v-model="warehouseInfo.warName"
              size="mini"
              @blur="search"
              placeholder="输入商品名搜索"/>
          </template>
          <template slot-scope="scope">
            <el-button size="mini" type="primary" @click="audit(scope.row.id,1)">允许通过</el-button>
            <el-button size="mini" type="danger" @click="audit(scope.row.id,2)">拒绝通过</el-button>
          </template>
        </el-table-column>
      </el-table>
      <div>
        <!-- 分页 -->
        <el-pagination
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="pageno"
          :page-sizes="[5, 10, 15, 20]"
          :page-size="pagesize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="total"
        >
        </el-pagination>
      </div>
      <div>
        <edit-shop ref="editShop"></edit-shop>
        <up-shop-num ref="upShopNum"></up-shop-num>
      </div>
    </div>
</template>

<script>
    export default {
        name: "assignWarehouseInfo",
        data(){
          return {
            shop:{
              id:"",
              isCheck:0,//等待审核
              isDelete:0//未被删除
            },
            shops:[],
            pageno: 1,
            pagesize: 5,
            total: 1
          }
        },
        methods:{
          getData(){
            //调用异步，根据条件，获取商品集合
            this.$axios.get("warehouseInfo/warehouseInfo.action",this.shop).
            then((response)=> {   //异步调用成功执行
              //将查询到的数据存入对象数组中
              this.warehouseInfos=response.data.records;
              this.total = response.data.total;
            }).catch(function (error) {//异步调用失败执行
              alert(error);
            });
          }
        },
        created() {
          this.getData();
        }
    }
</script>

<style scoped>

</style>
